package admin.server.controller;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import admin.common.domain.dto.UserDto;

import admin.common.vo.ResponseVO;
import admin.web.utils.CurrentUtil;

import javax.servlet.http.HttpServletRequest;

/**
 * @author zgb
 * @date 2024-03-27 15:08
 * @description TODO
 */
@Validated
@Slf4j
@RestController

@Tag(name = "当前 前端控制器")

@RequestMapping("/current")
public class CurrentController {

    @GetMapping(value = "/user")
    @Operation(summary = "当前用户 查询")
    public ResponseVO<UserDto> currentUserDto(HttpServletRequest request) throws Exception {
        return ResponseVO.OK(CurrentUtil.currentUserDto(request));
    }


}
